<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>JS三目运算符</title>
	</head>
	<body>
	</body>
	<script type="text/javascript">
		var score = 100;
		var txt = "";
		/* if(score > 80){
			 txt = "你能得到奖励";
		 }else{
			 txt = "你不能得到奖励";
		 }
		 console.log(txt); */

		// 精简一下   与上边if是等价的
		txt = score > 80 ? "你能得到奖励" : "你不能得到奖励";
		// console.log();
	</script>
</html>
